package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.ByUserFeedback;
import com.baseweb.webadmin.core.model.pojo.ByUserFeedbackExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ByUserFeedbackMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    int countByExample(ByUserFeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    int deleteByExample(ByUserFeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    @Delete({
        "delete from by_user_feedback",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    @Insert({
        "insert into by_user_feedback (user_id, img_url, ",
        "contact, descn, ",
        "status, create_time, ",
        "update_time)",
        "values (#{userId,jdbcType=INTEGER}, #{imgUrl,jdbcType=VARCHAR}, ",
        "#{contact,jdbcType=VARCHAR}, #{descn,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ByUserFeedback record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    int insertSelective(ByUserFeedback record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    List<ByUserFeedback> selectByExample(ByUserFeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    @Select({
        "select",
        "id, user_id, img_url, contact, descn, status, create_time, update_time",
        "from by_user_feedback",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ByUserFeedback selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    int updateByExampleSelective(@Param("record") ByUserFeedback record, @Param("example") ByUserFeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    int updateByExample(@Param("record") ByUserFeedback record, @Param("example") ByUserFeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    int updateByPrimaryKeySelective(ByUserFeedback record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_feedback
     *
     * @mbggenerated Mon Feb 06 01:08:19 CST 2017
     */
    @Update({
        "update by_user_feedback",
        "set user_id = #{userId,jdbcType=INTEGER},",
          "img_url = #{imgUrl,jdbcType=VARCHAR},",
          "contact = #{contact,jdbcType=VARCHAR},",
          "descn = #{descn,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ByUserFeedback record);
}